<?php
	if (!empty($search)) {
		echo '<div class="content_header">';
		echo __d('lil_blogs', 'Search Results', true);
		echo '</div>';
	} else {
		$this->set('title_for_layout', $this->Html->clean($blog['Blog']['name']));
	}
?>

<div id="post-index">

<?php foreach ($posts as $post) { ?>
<div class="post" id="post-<?php echo $post['Post']['id']; ?>">
	<h1>
	<?php
		echo $this->Html->link($post['Post']['title'], array(
			'plugin'     => 'lil_blogs',
			'controller' => 'posts',
			'action'     => 'view',
			'blog'       => $blog['Blog'][Configure::read('Lil.areaSlugField')],
			'post'       => $post['Post']['slug']));
	?>
	</h1>
	<div class="meta"><?php echo $this->element('meta', array('post' => $post)); ?></div>
	<div class="body"><?php echo $this->LilBlogs->excerpt($post); ?></div>
</div>
<?php }  // foreach ($posts as $post) ?>

<div class="paging">
<?php
	echo $this->Paginator->next(
		__d('lil_blogs', 'Older', true),
		array('url' => array('blog' => $blog['Blog'][Configure::read('Lil.areaSlugField')])),
		''
	);
	echo $this->Paginator->prev(	
		__d('lil_blogs', 'Newer', true),
		array('url' => array('blog' => $blog['Blog'][Configure::read('Lil.areaSlugField')])),
		''
	);
?>
</div>

</div>